function cvec=calvec(s0,s1,freq); 
%function cvec=calvec(s0,s1,freq); 
% Calendar Vector 
% s0 is starting dat 
% s1 is ending dat 
% freq= 'A', 'Q', 'M' 
% Monthly dates correspond to year.01 to year.12 
% Quarterly dates y.0, y.025, y.5 or y.75 
y0=floor(s0); 
e0=round(100*(s0-y0))/100; 
y1=floor(s1); 
e1=round(100*(s1-y1))/100;     
freq=upper(freq); 
if freq=='A' 
    cvec=(y0:y1)';
else 
    ny=y1-y0+1; 
    if freq=='M'; 
        mv=(1:1:12)'/100; 
        if isempty(find( e0 == mv)) == 1 | ...
                isempty(find(e1 == mv)) == 1; 
            error('Revise starting points'); 
        end 
        ev1=[e0;0.01*ones(ny-1,1)];
        ev2=[0.12*ones(ny-1,1);e1];     
    elseif freq=='Q'
        mv=(0:0.25:0.75)'; 
        if isempty(find( e0 == mv)) == 1 | ...
                isempty(find(e1 == mv)) == 1; 
            error('Revise starting points'); 
        end 
        
        ev1=[e0;zeros(ny-1,1)]; 
        ev2=[0.75*ones(ny-1,1);e1];
    end
    cvec=[];
    jj=1; 
    y=y0; 
    for jj=1:ny; 
        caux=calaux(y,ev1(jj),ev2(jj),freq); 
        cvec=[cvec;caux]; 
        y=y+1; 
    end 
end